import { DescItem } from '/@/components/Description/src/types';
import { TableImg } from '/@/components/Table';

export const schema: DescItem[] = [
  {
    field: 'title',
    label: '标题',
  },
  {
    field: 'area',
    label: '区域位置',
    render: (curVal, data) => {
      console.log(data, '区域');
      const content = `${data.province} / ${data.area}`;
      if (data.province) {
        return content;
      }
    },
  },
  {
    field: 'address',
    label: '详细地址',
  },
  {
    field: 'buildingName',
    label: '所属大楼',
  },
  {
    field: 'school',
    label: '周边学校',
  },
  {
    field: 'prices',
    label: '价格',
    render: (curVal, data) => {
      console.log(data, '区域');
      let content;
      if (data.province == '伦敦') {
        content = `￡${data.prices}`;
      } else {
        content = `$${data.prices}`;
      }
      if (data.prices) {
        return content;
      }
    },
  },
  {
    field: 'houseProperty',
    label: '房屋属性',
  },
  {
    field: 'houseType',
    label: '房屋种类',
  },
  {
    field: 'bedroom',
    label: '卧室数量',
  },
  {
    field: 'showers',
    label: '浴室数量',
  },
  {
    field: 'dwellingArea',
    label: '面积',
  },
  {
    field: 'houseDuty',
    label: '每月房地产税',
  },
  {
    field: 'cchoa',
    label: '每月CC/HOW',
  },
  {
    field: 'insurance',
    label: '每年保险',
  },

 
  {
    field: 'contactType',
    label: '联系方式',
    render: (curVal, data) => {
      console.log(data, '联系方式');
      let content;
      if (data.contactType == 0) {
        content = `微信 ： ${data.wechat}`;
      } else if (data.contactType == 1) {
        content = `电话 ： ${data.phone}`;
      } else if (data.contactType == 2) {
        content = `邮箱 ： ${data.email}`;
      }
      return content;
    },
  },
  {
    field: 'matchingFeatures',
    label: '业主配套特点',
  },
  {
    field: 'decorationFeatures',
    label: '房屋配置特点',
  },
  {
    field: 'remark',
    label: '房源详情',
  },
  {
    field: 'imgUrlsList',
    label: '照片',
    render: (curVal, data) => {
      console.log(data, '图片');
      // if (!data.imgUrlsList[0] == '') {

      return (
        <div style=" overflow: hidden">
          <TableImg size={250} imgList={data.imgUrlsList} />
        </div>
      );

      // }
    },
  },
  {
    field: 'videoUrl',
    label: '视频',
    render: (curVal, data) => {
      console.log(data);
      const list = [data.videoUrl];
      console.log(list, 'list');
      // return <TableImg size={120} simpleShow={true} imgList={list} />;
      if (!list[0] == '') {
        return <video src={data.videoUrl} controls="controls" width="200"></video>;
      }
    },
  },

  {
    field: 'floorplan',
    label: 'Floorplan',
    render: (curVal, data) => {
      console.log(data, '图片2');
      const list: any = [];
      if (data.floorplan) {
        list.push(data.floorplan);
      }
      if (!list[0] == '') {
        return (
          <div style=" overflow: hidden">
            <TableImg size={250} imgList={list} />
          </div>
        );
      }
    },
  },
  {
    field: 'vr',
    label: 'VR网址',
  },
];
